package psn.zjk.springboot.web;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import psn.zjk.springboot.App;

//@SpringBootApplication

/** 使用外置servlet容器:
 * 1.创建war项目，依赖设为provided
 * 2.继承SpringBootServletInitializer重写configure方法，是原有web.xml文件的替代
 * 3.配置外置tomcat启动
 * 4.作为启动类启动 */
public class UseOutsideContainerWebApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(UseOutsideContainerWebApplication.class, args);
    }

    @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(App.class);
    }
}
